<template>
	<view>
        <view class="eva-header">
            <view class="h-type" :class="tabIndex==0?'active':''" @click="showAppraise('0')">全部</view>
            <view class="h-type" :class="tabIndex==1?'active':''" @click="showAppraise('1')">待付款</view>
            <view class="h-type" :class="tabIndex==2?'active':''" @click="showAppraise('2')">待入住</view>
			<view class="h-type" :class="tabIndex==3?'active':''" @click="showAppraise('3')">已入住</view>
            <view class="h-type" :class="tabIndex==4?'active':''" @click="showAppraise('4')">待评价</view>
        </view>
		
		<view class="null-order" v-if="!orderList.length" style="justify-content: center;display: flex;align-items: center;margin: 150rpx;flex-direction: column;">
			<image src="../../static/icon/ordernull.png" style="width: 320rpx;height: 300rpx;" />
			<view style="font-size: 20rpx;color: #B0B0B0;">
				暂无相关订单
			</view>
		</view>
		
		<view class="goods-section" v-for="(item,index) in orderList" :key="index" v-else>
			<view class="g-header b-b">
				<text class="name">{{item.orderSn}}</text>
				<text class="g-status" v-if="item.orderStatus == 1">待付款</text>
				<text class="g-status" v-if="item.orderStatus == 2">待入住</text>
				<text class="g-status" v-if="item.orderStatus == 3">已入住</text>
				<text class="g-status" v-if="item.orderStatus == 4">已取消</text>
				<text class="g-status" v-if="item.orderStatus == 5">已关闭</text>
				<text class="g-status" v-if="item.orderStatus == 6">售后审核中</text>
				<text class="g-status" v-if="item.orderStatus == 9">等待酒店确定</text>
				<text class="g-status" v-if="item.orderStatus == 10">退房审核中</text>
				<text class="g-status" v-if="item.orderStatus == 11">订单异常</text>
			</view>
			<!-- 商品列表 -->
			<view class="g-item" :class="(item.orderStatus==1)?'disabled':''" v-for="(childItem,childIndx) in item.roomTypes" :key="childIndx"
				  @click="navToDetailPage(item.orderStatus,item.id)">
				<view class="panic" v-if="childItem.flashEndTime && item.status==0">
					<text class="tag" v-if="childItem.flashStatus=='start'">限时抢购中</text>
					<text class="tag" v-if="childItem.flashStatus=='end'">限时已结束</text>
					<text class="" v-if="childItem.flashStatus=='start'">距离优惠结束</text>
					<text class="" v-if="childItem.flashStatus=='start'">{{childItem.coutDownDie.a}}</text>
				</view>
				<image :src="childItem.imageUri"></image>
				<view class="right">
					<view class="title clamp">
						<view class="t-name">{{childItem.roomTypeName}}  </view>
						<!-- <text class="price" v-if="childItem.integralStatus=='1'">{{childItem.integral}}积分</text> -->
						
					</view>
					<view class="price-box">
               <!--         <view><img :src="childItem.nationalFlag" alt="">{{childItem.originCountry}}</view>
						<text class="number">x {{childItem.productQuantity}}</text> -->
					</view>
                    <view class="price-box return">
						<view class="spec">备注：{{childItem.description}}</view>
						<view class="refund o" v-if="childItem.refundStatus=='1'">退款中</view>
						<view class="refund" v-if="childItem.refundStatus=='2'">退款成功</view>
					</view>
					<!-- <text class="price" style="float: right;">￥{{childItem.orignPrice}}</text> -->
					<!--<view class="g-item re">-->
					<!--&lt;!&ndash;<view class="refund o" v-if="childItem.refundStatus=='1'">退款中</view>&ndash;&gt;-->
					<!--&lt;!&ndash;<view class="refund" v-if="childItem.refundStatus=='2'">退款成功</view>&ndash;&gt;-->
					<!--</view>-->
				</view>
			</view>
			<view class="g-item re" v-for="(childItem,childIndx) in item.orderItemList" :key="childIndx" >
				<!--<view class="refund" v-if="childItem.refundStatus=='1'">退款中</view>-->
				<!--<view class="refund" v-if="childItem.refundStatus=='2'">退款成功</view>-->
			</view>
			<view class="g-count">
				<text class="num">{{timedata(item.estimatedArriveTime)}}-{{timedata(item.estimatedDepartureTime)}}</text><text>合计：</text>
				<text class="total" v-if="item.orderItemList[0].integralStatus=='1'">{{item.orderItemList[0].integral * item.orderItemList[0].productQuantity}}积分</text>
				<text class="total" v-else>￥{{item.orderPay}}</text>
			</view>
			<view class="g-btn" v-if="item.orderStatus==1">
				<view class="g-cancel" @click.stop="cancelOrder(item.id)">取消订单</view>
				<view class="g-pay" @click.stop="goPay(item.id)">付款</view>
			</view>
			<view class="g-btn" v-if="(item.orderStatus!==1 && item.orderStatus!==4 && item.orderStatus!==7 && item.orderStatus!==8)&&item.confirmStatus==0">
				<view class="g-cancel" @click.stop="showLog(item.id,item.allCount,item.orderItemList[0].productPic)">查看物流</view>
				<view class="g-pay" @click.stop="conifrmPro(item.id,item.isHaveRefund)">确认收货</view>
			</view>
			<view class="g-btn" v-if="item.isComment==0&&item.orderStatus==7">
				<view class="g-cancel" @click.stop="showLog(item.id,item.allCount,item.orderItemList[0].productPic)">查看物流</view>
				<view class="g-pay" @click.stop="appraisePro(item.id,item.orderItemList)">评价</view>
			</view>
		</view>
        <uni-load-more :status="loadingType" v-if="false"></uni-load-more>
		<!--<view class="goods-section">-->
			<!--<view class="g-header b-b">-->
				<!--<text class="name">成都3仓</text>-->
                <!--<text class="g-status">已发货</text>-->
			<!--</view>-->
			<!--&lt;!&ndash; 商品列表 &ndash;&gt;-->
			<!--<view class="g-item">-->
				<!--<image src="https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=756705744,3505936868&fm=11&gp=0.jpg"></image>-->
				<!--<view class="right">-->
					<!--<view class="title clamp"><view class="t-name">【陈柏霖同款】OR2222222IGINS 悦木之...  </view><text class="price">￥17.8</text></view>-->
					<!--<view class="price-box">-->
						<!--<view><img src="/static/index/meiguo2@2x.png" alt="">哥伦比亚</view>-->
						<!--<text class="number">x 1</text>-->
					<!--</view>-->
					<!--<text class="spec">规格：200ml</text>-->
				<!--</view>-->
			<!--</view>-->
            <!--<view class="g-count">-->
                <!--<text class="num">共1件商品</text><text>合计：</text>-->
                <!--<text class="total">￥189</text>-->
            <!--</view>-->
            <!--<view class="g-btn">-->
                <!--<view class="g-cancel">查看物流</view>-->
                <!--<view class="g-pay">确认收货</view>-->
            <!--</view>-->
		<!--</view>-->
        <!--<view class="goods-section">-->
            <!--<view class="g-header b-b">-->
                <!--<text class="name">成都4仓</text>-->
                <!--<text class="g-status">交易成功</text>-->
            <!--</view>-->
            <!--&lt;!&ndash; 商品列表 &ndash;&gt;-->
            <!--<view class="g-item">-->
                <!--<image src="https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=756705744,3505936868&fm=11&gp=0.jpg"></image>-->
                <!--<view class="right">-->
                    <!--<view class="title clamp"><view class="t-name">【陈柏霖同款】OR2222222IGINS 悦木之...  </view><text class="price">￥17.8</text></view>-->
                    <!--<view class="price-box">-->
                        <!--<view><img src="/static/index/meiguo2@2x.png" alt="">哥伦比亚</view>-->
                        <!--<text class="number">x 1</text>-->
                    <!--</view>-->
                    <!--<text class="spec">规格：200ml</text>-->
                <!--</view>-->
            <!--</view>-->
            <!--<view class="g-count">-->
                <!--<text class="num">共1件商品</text><text>合计：</text>-->
                <!--<text class="total">￥189</text>-->
            <!--</view>-->
            <!--<view class="g-btn">-->
                <!--<view class="g-cancel">查看物流</view>-->
                <!--<view class="g-pay">评价</view>-->
            <!--</view>-->
        <!--</view>-->
		<!-- 金额明细 -->
		<view class="yt-list" v-if="false">
			<view class="yt-list-cell b-b">
				<text class="cell-tit clamp">商品合计</text>
				<text class="cell-tip">￥179.88</text>
			</view>
			<view class="yt-list-cell b-b">
				<text class="cell-tit clamp">优惠活动</text>
				<text class="cell-tip ">-￥35</text>
			</view>
            <view class="yt-list-cell b-b" @click="toggleMask('show')">
                <text class="cell-tit clamp">优惠券</text>
                <text class="cell-tip ">省20：满199减20元<text class="yticon icon-you"></text></text>
            </view>
			<view class="yt-list-cell b-b">
				<text class="cell-tit clamp">运费</text>
				<text class="cell-tip">免运费</text>
			</view>
            <view class="yt-list-cell b-b">
				<text class="cell-tit clamp">税费</text>
				<text class="cell-tip">0</text>
			</view>
			<!--<view class="yt-list-cell desc-cell">-->
				<!--<text class="cell-tit clamp">备注</text>-->
				<!--<input class="desc" type="text" v-model="desc" placeholder="请填写备注信息" placeholder-class="placeholder" />-->
			<!--</view>-->
		</view>

		<!-- 优惠券面板 -->
		<view class="mask" :class="maskState===0 ? 'none' : maskState===1 ? 'show' : ''" @click="toggleMask">
			<view class="mask-content" @click.stop.prevent="stopPrevent">
				<!-- 优惠券页面，仿mt -->
				<view class="coupon-item" v-for="(item,index) in couponList" :key="index">
					<view class="con">
						<view class="left">
							<text class="title">{{item.title}}</text>
							<text class="time">有效期至2019-06-30</text>
						</view>
						<view class="right">
							<text class="price">{{item.price}}</text>
							<text>满30可用</text>
						</view>
						
						<view class="circle l"></view>
						<view class="circle r"></view>
					</view>
					<text class="tips">限新用户使用</text>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
    import {_orderList,_orderCancel,_confirmPro} from '../../common/vmeitime-http/order.js';
	import {_cancelCreate} from '../../common/vmeitime-http/pay.js'
    import utils from '../../common/utils/util.js';
    let t=null;
    import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
	export default {
        components: {
            uniLoadMore
        },
		data() {
			return {
				btnflag:0,//点击标志位
                tabIndex:0,
				maskState: 0, //优惠券面板显示状态
				desc: '', //备注
				payType: 1, //1微信 2支付宝
				couponList: [
					{
						title: '新用户专享优惠券',
						price: 5,
					},
					{
						title: '庆五一发一波优惠券',
						price: 10,
					},
					{
						title: '优惠券优惠券优惠券优惠券',
						price: 15,
					}
				],
				addressData: {
					name: '许小星',
					mobile: '13853989563',
					addressName: '金九大道',
					address: '山东省济南市历城区',
					area: '149号',
					default: false,
				},
				orderList:[],
                nowTime:[],//当前时间准备
                coutDownDie:{
                    a:'23',
                    b:"59",
                    c:"59"
                },
                loadingType: 'more', //加载更多状态
                pageThis:{
                    num:1,
                    size:20
                }
			}
		},
		computed: {
		    // 计算属性的 getter
		    timedata() {
			   return function (date) {
				   console.log(date)
				   if(!date){
					   return null
				   }
			            // return date.split(' ')[0].split('-')[1]+'月'+date.split(' ')[0].split('-')[2]+'日'
						return this.dateconversion(date,"yms","/")
			        }
			  
		    }
		  },
		onLoad(options){
			//订单列表
			//let data = JSON.parse(option.data);
			//console.log(data);

			if(options.state){
                this.tabIndex = options.state;
			}

		},
		onShow(){
            this.gotList(this.tabIndex)
		},
        onPageScroll(e){
            //兼容iOS端下拉时顶部漂移
            if(e.scrollTop>=0){
                this.headerPosition = "fixed";
            }else{
                this.headerPosition = "absolute";
            }
        },
        //下拉刷新
        onPullDownRefresh(){
            this.gotList(0,'refresh');
        },
        //加载更多
        onReachBottom(){
//            this.loadData();
        },
		methods: {
			// 自定义时间格式方法
			dateconversion(time,format,split){
				if(!split){
					split = "/"
				}
				var returndate = ""
				console.log(time)
				console.log(new Date(time + 8 * 3600 * 1000))
				var date = new Date(time + 8 * 3600 * 1000).toJSON().substr(0, 19).replace('T', '-').split('-')
				var datex = {
					y:date[0],
					m:date[1],
					s:date[2],
					t:date[3],
				}
				var formatarr = format.split("")
				for(let i = 0;i<formatarr.length;i++){
					if(i == 0){
						returndate = datex[formatarr[i]]
					}else{
						returndate = returndate+split+datex[formatarr[i]]
					}
				}
				return returndate;
			},
			
			
			//显示优惠券面板
            /*抢购时间重载*/
            panicTimeLoad(nowTime,timeArr){
                uni.showLoading()
                // {fIndex:index,
                //     cIndex:cIndex,
                //     s:cItem.flashStartTime,
                //     e:cItem.flashEndTime
                // }
                let tempTarr = timeArr;/*赋值新的数组*/

				this.nowTime = [];
                let nowDate = new Date(nowTime);
                this.nowTime.push(utils.formatDate.format(nowDate,'hh:mm:ss').split(":")[0]);
                this.nowTime.push(utils.formatDate.format(nowDate,'hh:mm:ss').split(":")[1]);
                this.nowTime.push(utils.formatDate.format(nowDate,'hh:mm:ss').split(":")[2]);

                /*倒计时计算*/
                tempTarr.forEach((item)=>{
                    console.log(item.e)
                    let countDown = utils.formatDate.format(new Date(item.e),'hh:mm:ss').split(":");
                    console.log(countDown);
                    if(countDown[0]==23){
                        countDown[0]=24
                    }else if(countDown[0]=="00"){
                        countDown[0]=24
                    }
                    item.tempH = parseInt(countDown[0]-1 - this.nowTime[0]);//时
                    item.tempM = 59 - this.nowTime[1];//分
                    item.tempS = 59 - this.nowTime[2];//秒
                });
                let _this = this;
                clearInterval(t);
                t = setInterval(function () {
                    // if(tempH==0&&tempM==0&&tempS==0){
                    //
                    //     clearInterval(t)
                    // }
                    if( _this.orderList.length==0){
                        clearInterval(t)
                    }
                    tempTarr.forEach((item)=>{
                        if((item.tempH==0&&item.tempM==0&&item.tempS==0) || item.tempH<0){
                            _this.orderList[item.fIndex].orderItemList[item.cIndex].flashStatus = "end"
                            // clearInterval(t)
                        }else{
                            if(item.tempS==0){
                                item.tempS = 59;
                                if(item.tempM==0){
                                    item.tempM = 59
                                    if(item.tempH==0){
                                        item.tempH = 23;
                                        // this.panicTimeLoad()
                                    }else{
                                        item.tempH--
                                    }
                                }else{
                                    item.tempM--
                                }
                            }else{
                                item.tempS--
                            }
                            let tH = item.tempH>9?item.tempH:'0'+item.tempH;
                            let tM = item.tempM>9?item.tempM:'0'+item.tempM;
                            let tS = item.tempS>9?item.tempS:'0'+item.tempS;
                            _this.orderList[item.fIndex].orderItemList[item.cIndex].coutDownDie.a=tH+":"+tM+":"+tS;
                            uni.$emit('updateCountDownOrder',{updateCountDown:tH+":"+tM+":"+tS,cId:_this.orderList[item.fIndex].orderItemList[item.cIndex].id});
                        }
                    });
//                    console.log(_this.orderList);
                    let tList= _this.orderList
//                    _this.orderList = [];
                    _this.orderList = JSON.parse(JSON.stringify(tList));
//                    _this.coutDownDie = tH+":"+tM+":"+tS;

//					console.log(_this.coutDownDie)
                    uni.hideLoading();
                },1000);
            },
			toggleMask(type){
				let timer = type === 'show' ? 10 : 300;
				let	state = type === 'show' ? 1 : 0;
				this.maskState = 2;
				setTimeout(()=>{
					this.maskState = state;
				}, timer)
			},
			numberChange(data) {
				this.number = data.number;
			},
			changePayType(type){
				this.payType = type;
			},
			submit(){
				uni.redirectTo({
					url: '/pages/money/pay'
				})
			},
			stopPrevent(){},
			/*切换选项卡*/
            showAppraise(n){
				var n1 = null
				if(n == 0){
					n1 = 5
				}else{
					n1 = n
				}
                this.tabIndex = n;
                this.gotList(n1)
            },
			async gotList(status,type='add', loading){
                //没有更多直接返回
                if(type === 'add'){
                    if(this.loadingType === 'nomore'){
                        return false;
                    }
                    this.loadingType = 'loading';
                }else{
                    this.loadingType = 'more'
                }

                /*-*/
                if(type === 'refresh'){
                    clearInterval(t);
                    this.orderList = [];
                    status = 5;
                    this.tabIndex = 0;
                    this.pageThis.num = 1;
                    this.pageThis.size = 20
                }
                let para = {
					type:status
				};
				if(para.type ==0){
					para.type = 5
				}
                let tempStatus = await _orderList(para);
                this.orderList = tempStatus.data.data;
                uni.stopPullDownRefresh();
//                /*loading-page*/
//                let goodsList = productCate.data.data.list;
//                let totalPage = productCate.data.data.totalPage;
//                let pNum = this.page.num++;
//                this.page.num = totalPage>pNum?pNum+1:totalPage;
//                /*-*/
//
//                this.goodsList = this.goodsList.concat(goodsList);
//
//                //判断是否还有下一页，有是more  没有是nomore(测试数据判断大于20就没有了)
//                this.loadingType  = totalPage > pNum ? 'more' : 'nomore';
//                if(type === 'refresh'){
//                    if(loading == 1){
//                        uni.hideLoading()
//                    }else{
//                        uni.stopPullDownRefresh();
//                    }
//                }
//                /*loading-page-end*/

                /*抢购类型判断*/
                let tempSetTime = [];
                let tempNowtime = tempStatus.data.nowTime;
                // this.orderList.forEach((item,index)=>{
                //     item.orderItemList.forEach((cItem,cIndex)=>{
                //         /*测试*/
                //         // if(cIndex==0){
                //         //     cItem.flashStatus = "end";
                //         // }


                //         /**/
                //         if(cItem.flashEndTime && cItem.flashEndTime!==""){
                //             cItem.flashStatus = tempNowtime > cItem.flashEndTime?'end':'start';
                //             if(cItem.flashStatus=="start"){
                //                 cItem.coutDownDie = {};
                //                 tempSetTime.push(
                //                     {
                //                         fIndex:index,
                //                         cIndex:cIndex,
                //                         s:cItem.flashStartTime,
                //                         e:cItem.flashEndTime
                //                     }
                //                 )
                //             }
                //         }
                //     })
                // });
                console.log(tempSetTime);
                if(tempSetTime.length>0){
                    this.panicTimeLoad(tempNowtime,tempSetTime)
                }
                console.log(tempStatus)
            },
			/*去付款*/
            goPay(id){
//               /*判断抢购是否结束*/
//                 let pStatic = false;/*抢购结束状态默认值*/
//                 let tempPanic = item1.orderItemList;
//                 console.log("!11111111111111111111");
//                 tempPanic.forEach((item)=>{
//                     if(item.flashEndTime){
//                         if(item.flashStatus=="end"){
//                             pStatic = true;
// //                            throw new Error("break")
//                         }
//                     }
//                 });
//                 if(pStatic){
//                     uni.showModal({
//                         title: '提示',
//                         content: '当前订单中的商品抢购已结束，点击确定刷订单状态',
//                         showCancel:false,
//                         confirmText:"确定",
//                         confirmColor:"#017F01",
//                         success: function (res) {
//                             if (res.confirm) {

//                             } else if (res.cancel) {

//                             }
//                         }
//                     });
//                     return false;
//                 }
                /*end*/
				console.log(id)
                if(id){
                    console.log(id);
                    uni.navigateTo({
                    	url:"../OrderDetails/OrderDetails?static=2&id="+id
                    })
				}
				// else{
    //                 if(totalAmount==0){
    //                     uni.showModal({
    //                         title: '提示',
    //                         content: '支付金额为0，将不能正常下单哦，请您选择其他优惠券支付哦！',
    //                         showCancel:false,
    //                         confirmText:"确定",
    //                         confirmColor:"#017F01",
    //                         success: function (res) {
    //                             if (res.confirm) {

    //                             } else if (res.cancel) {

    //                             }
    //                         }
    //                     });
				// 	}
    //                 uni.redirectTo({
    //                     url: '/pages/money/pay?orderId='+id+'&t='+totalAmount
    //                 })
				// }

			},
			/*取消订单*/
			async cancelOrder(id){
                let tempCancel = await _cancelCreate({orderId:id})
                if(tempCancel.data.code==200){
                    this.gotList(this.tabIndex)
                }
			},
			/*查看物流*/
            showLog(orderId,count,pic){
                uni.navigateTo({
                    url: `/pages/logistics/logistics?orderId=${orderId}&count=${count}&pic=${pic}`
                })
			},
			/*确认收货*/
            async conifrmPro(orderId,isHaveRefund){
                if(isHaveRefund && isHaveRefund==1){
                    uni.showModal({
                        title: '提示',
                        content: '当前订单有正在退款的商品，取消退款后才能确认收货哦',
                        showCancel:false,
                        confirmText:"知道啦",
                        confirmColor:"#017F01",
                        success: function (res) {
                            if (res.confirm) {

                            } else if (res.cancel) {

                            }
                        }
                    });
                    return false;
                }
				let tempData = await _confirmPro({id:orderId});
				/*成功后跳转评价页面*/
				if(tempData.data.code==200){
                    this.$api.msg("确认收货成功！");
                    setTimeout(function () {
                        uni.navigateTo({
                            url: `/pages/appraise/release?orderId=${orderId}`
                        })
                    },1000);
//                    setTimeout(function () {
//                        uni.switchTab({
//                            url: '/pages/index/index'
//                        });
//                    },1000)
				}
			},
            /*发布评价*/
            appraisePro(orderId,orderItemList){
                let rCount=0;
                /*商品已退款，*/
                console.log(orderItemList);
                for(let item of orderItemList){
                    if(item.refundStatus==1||item.refundStatus==2){
                        rCount++
                    }
                }
				if(rCount==orderItemList.length){
                    uni.showModal({
                        title: '提示',
                        content: '当前订单已完成退款，无法继续评价哟',
                        showCancel:false,
                        confirmText:"知道啦",
                        confirmColor:"#017F01",
                        success: function (res) {
                            if (res.confirm) {

                            } else if (res.cancel) {

                            }
                        }
                    });
				}else{
                    /*成功后跳转评价页面*/
                    uni.navigateTo({
                        url: `/pages/appraise/release?orderId=${orderId}`
                    })
				}
            },
            //详情
            // <text class="g-status" v-if="item.status==3&&item.confirmStatus==0">待收货</text>
        // <text class="g-status" v-if="item.status==3&&item.confirmStatus==1">待评价</text>
            navToDetailPage(count,orderId){
				console.log(orderId)
				console.log(count)
				if(this.btnflag == 0){
					this.btnflag = 1
					switch(count){
						case 1:
							uni.navigateTo({
								url:"../OrderDetails/OrderDetails?static=2&id="+orderId
							})
							break;
						case 2:
							uni.navigateTo({
								url:"../OrderDetails/OrderDetails?static=1&id="+orderId
							})
							break;
						case 4:
							uni.navigateTo({
								url:"../OrderDetails/OrderDetails?static=4&id="+orderId
							})
							break;
						case 3:
							uni.navigateTo({
								url:"../OrderDetails/OrderDetails?static=0&id="+orderId
							})
							break;
						case 9:
							uni.navigateTo({
								url:"../OrderDetails/OrderDetails?static=9&id="+orderId
							})
							break;
						case 10:
							uni.navigateTo({
								url:"../OrderDetails/OrderDetails?static=10&id="+orderId
							})
							break;
					}
					this.btnflag = 0
				}
				
				// uni.navigateTo({
				// 	url:"../OrderDetails/OrderDetails?static=1&id="+orderId
				// })
//                return false;
                //测试数据没有写id，用title代替
//				let id = item.title;
				// if(orderStatus==0){
				//     orderStatus = "detailPay";
				// }else if(refundStatus==2){
    //                 orderStatus = "refund"
    //             }else if((orderStatus!==0&&orderStatus!==7)&&confirmStatus==0){
    //                 orderStatus = "pending"
				// }else if((isComment==0)&&confirmStatus==1){
    //                 orderStatus = "comment"
				// }else if((isComment==1)&&confirmStatus==1){
    //                 orderStatus = "finish"
				// }
				// dataS = JSON.stringify(dataS);
					

            },
		}
	}
</script>

<style lang="scss">
	page {
		background: $page-color-base;
		padding-bottom: 100upx;
	}
    /*头部*/
    .eva-header{
        display: flex;
        padding: 26upx 35upx 0;
        justify-content:space-between;
        background: #ffffff;
        .h-type{
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 26upx;
            color: $font-color-dark;
            height: 53upx;
            padding: 0 20upx 20upx 30upx;
            border-bottom: 4upx solid #ffffff;
            /*flex: 1;*/
            &.active{
                border-bottom: 4upx solid $uni-color-primary;
                color: $uni-color-primary;
            }
        }
    }
    /*列表*/
	.goods-section {
		margin-bottom: 20upx;
		background: #fff;
		padding-bottom: 1px;

		.g-header {
			display: flex;
			align-items: center;
			height: 84upx;
			padding: 0 30upx;
			position: relative;
            .g-status{
                color: $uni-color-primary;
                font-size: 30upx;
                flex: 1;
                display: flex;
                align-items: center;
                justify-content: flex-end;
				&.ok{
					color: #F69418;
				}
            }
            .name {
                font-size: 25upx;
                color: $font-color-dark;
                /*margin-left: 24upx;*/
                // font-weight: bold;
            }
		}
		.g-item {
			display: flex;
			margin: 20upx 30upx;
            flex-wrap: wrap;
			image {
				flex-shrink: 0;
				display: block;
				width: 140upx;
				height: 140upx;
				border-radius: 4upx;
			}

			.right {
				flex: 1;
				padding-left: 24upx;
				overflow: hidden;
			}

			.title {
				font-size: 30upx;
				color: $font-color-dark;
                .t-name{
                    width: 376upx;
                    overflow: hidden;
                    white-space: nowrap;
                    text-overflow: ellipsis;
                }
                .price{
                    font-size: 26upx;
                    color: #656565;
                    float: right;
                    margin-top: -38rpx;
                }
			}

			.spec {
				font-size: 22upx;
				color: $font-color-light;
			}

			.price-box {
				/*display: flex;*/
				align-items: center;
				font-size: 24upx;
				color: #989898;
				padding-top: 10upx;
				view{
					display: flex;
					align-items: center;
				}
				.price {
					margin-bottom: 4upx;
				}
				.number{
					font-size: 26upx;
					color: $font-color-base;
					margin-left: 20upx;
                    float: right;
                    margin-top: -34rpx;
                }
                img{

                    margin-right: 10upx;
					width: 24rpx;
					height: 24rpx;
					display: inline-block;
					border-radius: 50%;
					vertical-align: top;
					/*margin-top: 6rpx;*/

				}
			}
			.price-box.return{
				display: flex;
				.spec{
					flex:1;
				}
				.refund{
					font-size: 24rpx;
					color: #539191;
					&.o{
						color: #F69418;
						font-size: 26rpx;
					}
				}
			}
			.step-box {
				position: relative;
			}
            &.disabled{
                .panic{
                    color: #DADADA;
                    .tag{
                        color: #DADADA;
                        border: 2upx solid #DADADA;
                    }
                }

                .right{
                    .title,.price,.attr,.unit{
                        .t-name,.price{
                            color: #DADADA;
                        }
                        color: #DADADA;
                    }
                    .price-box{
                        color: #DADADA;
                        .number{
                            color: #DADADA;
                        }
                    }
                    .spec{
                        color:#DADADA;
                    }
                    .unit{
                        text{
                            color: #DADADA;
                        }
                    }
                }


            }
		}
		.g-item.re{
			display: block;
			margin-right: 0;
			.refund{
				font-size: 24rpx;
				color: #539191;
				float: right;
				margin-top: -59rpx;
				&.o{
					color: #F69418;
					font-size: 26rpx;
				}
			}
		}
		.g-count{
			display: flex;
			font-size: 24upx;
			color: #656565;
			align-items: center;
			justify-content: flex-end;
            padding: 0 30upx;
            .num{
				margin-right: 10upx;
			}
			.total{
				color: #FF9948;
				font-size: 35upx;
				margin-left: 10upx;
			}
		}
        .g-btn{
            font-size: 26upx;
            display: flex;
            justify-content: flex-end;
            padding: 30upx;
            .g-cancel{
                width: 160upx;
				height: 63upx;
				text-align: center;
				line-height: 59upx;
                border-radius: 60upx;
                color: #989898;
                border: 2upx solid #989898;
                margin-right: 20upx;
            }
            .g-pay{
                width: 160upx;
                height: 63upx;
				text-align: center;
				line-height: 59upx;
                border-radius: 60upx;
                color: $uni-color-primary;
                border: 2upx solid $uni-color-primary;
            }
        }
	}
	.yt-list {
		margin-top: 16upx;
		background: #fff;
	}

	.yt-list-cell {
		display: flex;
		align-items: center;
		padding: 10upx 30upx 10upx 40upx;
		line-height: 70upx;
		position: relative;

		&.cell-hover {
			background: #fafafa;
		}

		&.b-b:after {
			left: 30upx;
		}

		.cell-icon {
			height: 32upx;
			width: 32upx;
			font-size: 22upx;
			color: #fff;
			text-align: center;
			line-height: 32upx;
			background: #f85e52;
			border-radius: 4upx;
			margin-right: 12upx;

			&.hb {
				background: #ffaa0e;
			}

			&.lpk {
				background: #3ab54a;
			}

		}

		.cell-more {
			align-self: center;
			font-size: 24upx;
			color: $font-color-light;
			margin-left: 8upx;
			margin-right: -10upx;
		}

		.cell-tit {
			flex: 1;
			font-size: 26upx;
			color: $font-color-dark;
			margin-right: 10upx;
		}

		.cell-tip {
			font-size: 26upx;
			color: $font-color-dark;

			&.disabled {
				color: $font-color-light;
			}

			&.active {
				color: $base-color;
			}
			&.red{
				color: $base-color;
			}
		}

		&.desc-cell {
			.cell-tit {
				max-width: 90upx;
			}
		}

		.desc {
			flex: 1;
			font-size: $font-base;
			color: $font-color-dark;
		}
	}
	
	/* 支付列表 */
	.pay-list{
		padding-left: 40upx;
		margin-top: 16upx;
		background: #fff;
		.pay-item{
			display: flex;
			align-items: center;
			padding-right: 20upx;
			line-height: 1;
			height: 110upx;	
			position: relative;
		}
		.icon-weixinzhifu{
			width: 80upx;
			font-size: 40upx;
			color: #6BCC03;
		}
		.icon-alipay{
			width: 80upx;
			font-size: 40upx;
			color: #06B4FD;
		}
		.icon-xuanzhong2{
			display: flex;
			align-items: center;
			justify-content: center;
			width: 60upx;
			height: 60upx;
			font-size: 40upx;
			color: $base-color;
		}
		.tit{
			font-size: 32upx;
			color: $font-color-dark;
			flex: 1;
		}
	}
	/* 优惠券面板 */
	.mask{
		display: flex;
		align-items: flex-end;
		position: fixed;
		left: 0;
		top: var(--window-top);
		bottom: 0;
		width: 100%;
		background: rgba(0,0,0,0);
		z-index: 9995;
		transition: .3s;
		
		.mask-content{
			width: 100%;
			min-height: 30vh;
			max-height: 70vh;
			background: #f3f3f3;
			transform: translateY(100%);
			transition: .3s;
			overflow-y:scroll;
		}
		&.none{
			display: none;
		}
		&.show{
			background: rgba(0,0,0,.4);
			
			.mask-content{
				transform: translateY(0);
			}
		}
	}

	/* 优惠券列表 */
	.coupon-item{
		display: flex;
		flex-direction: column;
		margin: 20upx 24upx;
		background: #fff;
		.con{
			display: flex;
			align-items: center;
			position: relative;
			height: 120upx;
			padding: 0 30upx;
			&:after{
				position: absolute;
				left: 0;
				bottom: 0;
				content: '';
				width: 100%;
				height: 0;
				border-bottom: 1px dashed #f3f3f3;
				transform: scaleY(50%);
			}
		}
		.left{
			display: flex;
			flex-direction: column;
			justify-content: center;
			flex: 1;
			overflow: hidden;
			height: 100upx;
		}
		.title{
			font-size: 32upx;
			color: $font-color-dark;
			margin-bottom: 10upx;
		}
		.time{
			font-size: 24upx;
			color: $font-color-light;
		}
		.right{
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			font-size: 26upx;
			color: $font-color-base;
			height: 100upx;
		}
		.price{
			font-size: 44upx;
			color: $base-color;
			&:before{
				content: '￥';
				font-size: 34upx;
			}
		}
		.tips{
			font-size: 24upx;
			color: $font-color-light;
			line-height: 60upx;
			padding-left: 30upx;
		}
		.circle{
			position: absolute;
			left: -6upx;
			bottom: -10upx;
			z-index: 10;
			width: 20upx;
			height: 20upx;
			background: #f3f3f3;
			border-radius: 100px;
			&.r{
				left: auto;
				right: -6upx;
			}
		}
	},

    /*抢购倒计时*/
    .panic{
        font-size: $font-sm - 2upx;
        padding: 20rpx 0 20rpx 170rpx;
        width: 100%;
        .tag{
            color: $uni-color-primary;
            border: 2upx solid $uni-color-primary;
            padding: 5upx 10upx;
            border-radius: 50upx;
        }
        text{
            margin-right: 10upx;
        }
    }

</style>
